import React from 'react';
import { connect } from 'dva';
import { Button } from 'antd';
import styles from '../components/module/Module.css';
import ModuleTable from '../components/module/ModuleTable';
import ModuleEditModal from '../components/module/ModuleEditModal';
import MainLayout from '../components/MainLayout/MainLayout';

const ModulePage = ({location,dispatch}) => {
  const okHandler = (values) =>{
    dispatch({type: 'Module/add', values});
  };

  const body = (
    <MainLayout location={location}>
      <div className={styles.normal}>
        <ModuleEditModal record={{}} okHandler={okHandler} >
          <Button type="primary">Create User</Button>
        </ModuleEditModal>
        <ModuleTable/>
      </div>
    </MainLayout>
  );
  return body ;
}


export default connect()(ModulePage);
